怎麼檢查 object 是不是空的?


Posted by Rich on 2021-09-12

有時候會有這種需求,這次解決的幫手是:

let obj = {}
if (Object.keys(obj).length === 0) //true

怕忘記,紀錄一下。










Related Posts

number 類型的內建函式

number 類型的內建函式

python源起

python源起

Command Line 指令 & Vim 心得筆記

Command Line 指令 & Vim 心得筆記


Comments